#include "people.h"

People::People(std::string name, People::SEX sex, double weight, double height, std::string appearance)
{
    m_sex = sex;
    m_name = name;
    m_weight = weight;
    m_height = height;
    m_appearance = appearance;
}

People::~People()
{

}

bool People::operator <(const People &b)
{
    return this->m_name < b.name();
}

bool People::operator ==(const People &b)
{
    return this->m_name == b.name();
}

double People::weight() const
{
    return m_weight;
}

void People::setWeight(double weight)
{
    m_weight = weight;
}

double People::height() const
{
    return m_height;
}

void People::setHeight(double height)
{
    m_height = height;
}

People::SEX People::sex() const
{
    return m_sex;
}

void People::setSex(const People::SEX &sex)
{
    m_sex = sex;
}

std::string People::name() const
{
    return m_name;
}

void People::setName(const std::string &name)
{
    m_name = name;
}

std::string People::appearance() const
{
    return m_appearance;
}

void People::setAppearance(const std::string &appearance)
{
    m_appearance = appearance;
}

std::string People::show_me()
{
    char describation[128] = {0};

    std::string sex("Man");
    if (m_sex == WOMAN)
    {
        sex = "WoMan";
    }
    if (m_sex == UNKONW)
    {
        sex = "unkonw";
    }
    snprintf(describation, sizeof(describation) - 1,
             "name:%s\nsex:%s\n%.2lfcm\n%.2lfkg\nappreance:%s\n", m_name.c_str(), sex.c_str(), m_height,
             m_weight, m_appearance.c_str());
    return describation;
}

int People::age() const
{
    return m_age;
}

void People::setAge(int age)
{
    m_age = age;
}
